<%
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
%>

<% js_bundle :link_enrollment %>
<div id="link_student_dialog" style="display: none;">
  <a href="<%= context_url(@context, :context_students_url) %>" class="student_url" style="display: none;">&nbsp;</a>
  <%= form_tag context_url(@context, :context_link_enrollment_url), {:id => "link_student_dialog_form"} do %>
    <input type="hidden" name="enrollment_id" class="enrollment_id ic-Input"/>
    <%= mt 'details', %{When an observer is linked to a student, they have access to that student's grades and course interactions. *Right now this observer is linked to the student, %{student}.*

To link the course observer %{user} to a student, select the student's name from the list below.},
            :wrapper => '<span class="existing_user"> \1</span>',
            :student => '<b class="existing_user_name">&nbsp;</b>'.html_safe,
            :user => '<b class="short_name">&nbsp;</b>'.html_safe %>
    <p class="loading_message">{{#t}}Loading Students...{{/t}}</p>
    <p class="students_link" style="display: none;">
      <label for="student_enrollment_link_option" class="ic-Label"><%= before_label('student', %{Student}) %></label>
      <select name="student_id" class="student_options" id="student_enrollment_link_option">
        <option value="none" class="blank">[ {{#t}}Select Student{{/t}} ]</option>
      </select>
    </p>
    <div class="button-container">
      <button type="submit" class="btn save_button">{{#t}}Link to Student{{/t}}</button>
      <button type="button" class="btn button-secondary cancel_button">{{#t}}Cancel{{/t}}</button>
    </div>
  <% end %>
</div>
